import pandas as pd


def gen_time_matrix(yesterday='2019-11-24', city_id='0', cate_id='0'):
    """
    生成时间矩阵
    :return:
    """
    df_artisans = pd.read_csv('/data/disp/' + yesterday + '/artisans_' + city_id + '_' + cate_id + '.csv')
    df_orders = pd.read_csv('/data/disp/' + yesterday + '/orders_' + city_id + '_' + cate_id + '.csv')
    # 1.首先找出手艺人的出发点作为必经之路
    df_points = df_artisans[['artisan_id', 'lon', 'lat']]
    df_points.rename({'artisan_id': 'id'}, axis=1, inplace=True)
    df_points['start'] = 0
    df_points['stop'] = 1
    df_address = df_orders[['order_seq', 'start', 'stop', 'lon', 'lat']]
    df_points = df_points.merge(df_address)
